package com.tang.websocket.v1.handler;

import com.tang.websocket.v1.message.WebSocketMessage;
import com.tang.websocket.v1.session.WebSocketSession;

import java.io.IOException;

/**
 * @author Tang
 * @classname WebSocketHandler
 * @description [ 定义处理的动作 ]
 * @date 2022/11/25 17:00
 */
public interface WebSocketHandler {

    void onOpen(WebSocketSession webSocketSession);

    void onMessage(WebSocketSession webSocketSession, WebSocketMessage<?> message) throws IOException;

    void onClose(WebSocketSession webSocketSession);

    void onError(WebSocketSession webSocketSession,Throwable e);

}